package com.rattsoftware.server.dao;

import java.util.List;

import com.rattsoftware.server.admin.model.Department;
import com.rattsoftware.server.admin.model.paging.PagingLoadConfig;
import com.rattsoftware.server.admin.model.paging.PagingLoadResult;

/**
 * Provides data access 
 * services to the <code>Department service</code>.
 * 
 *
 */
public interface DepartmentDAO extends BaseDAO<Department> {
	
	/**
	 * Gets a list of Department in the database.
	 * 
	 * @return the department list.
	 */
	List<Department> getDepartments();
	
	/**
	 * Retrieves a Department by identifier
	 * 
	 * @param id Integer 
	 * @return Department, or null if no match found
	 */
	Department getDepartment(Integer id);
	
	/**
	 * Retrieves a Department by identifier
	 * 
	 * @param departmentName String 
	 * @return Department, or null if no match found
	 */
	Department getDepartment(String departmentName);
	
	/**
	 * Saves a department to the database.
	 * 
	 * @param department the department to save.
	 */
	void saveDepartment(Department department);
	
	/**
	 * Removes a department from the database.
	 * 
	 * @param department the department to remove.
	 * 
	 */
	void deleteDepartment(Department department);
	
	/**
	 * Retrieves a page of the Department data.
	 * 
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of course data
	 */
	PagingLoadResult<Department> getDepartmentList(PagingLoadConfig pagingLoadConfig);
	
	/**
	 * Retrieves a page of the department data that belongs to a given faculty.
	 * @param facultyId
	 *            Integer
	 * @param pagingLoadConfig
	 *            config to specify paging related config
	 * @return PagingLoadResult containing a page of Course Unit data
	 */
	PagingLoadResult<Department> getDepartmentList(Integer facultyId, PagingLoadConfig pagingLoadConfig);
}
